local sk__xingyi = fk.CreateSkill {

  name = "sk__xingyi",

  tags = {},

}



sk__xingyi:addEffect("active", {
  name = "sk__xingyi",
  anim_type = "support",
  card_num = 0,
  target_num = 1,
  prompt = "#sk__xingyi",
  can_use = function(self, player)
    return player:usedSkillTimes(sk__xingyi.name, Player.HistoryPhase) == 0
  end,
  card_filter = Util.FalseFunc,
  target_filter = function(self, player, to_select, selected, selected_cards)
    return #selected == 0 and to_select ~= player and not to_select:isKongcheng()
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    local target = effect.tos[1]
    local card = room:askForCardChosen(player, target, "h", sk__xingyi.name, "#sk__xingyi-choose::" .. target.id)
    room:moveCardTo(card, Card.PlayerHand, player, fk.ReasonPrey, sk__xingyi.name, nil, true, player)
    if not target.dead and target:isWounded() then
      room:recover {
        who = target,
        num = 1,
        recoverBy = player,
        skillName = sk__xingyi.name,
      }
    end
  end,
})

return sk__xingyi
